from django.conf.urls import url
from .views import views,typeviews,goodsviews,order

# 子路由
urlpatterns = [
    # 后台首页以及登录
    url(r'^$',views.index,name='index'),
    url(r'^login$', views.login, name='login'),
    url(r'^vcode$', views.verifycode, name='vcode'),     #验证码
    url(r'^dologin$', views.dologin, name='dologin'),     #验证码
    url(r'^loginout$',views.loginout,name='loginout'),
    url(r'^vcodeajax$',views.vcodeajax,name='vcodeajax'),

    # 后台会员管理
    url(r'^user/add$', views.useradd,name='user_add'),
    url(r'^user/insert$',views.uinsert,name='user_insert'),
    url(r'^user/list$',views.ulist,name='user_list'),
    url(r'^user/edit/([0-9]+)$',views.uedit,name='user_edit'),
    url(r'^user/usave$',views.usave,name='user_save'),
    url(r'^user/del/([0-9]+)$',views.udel,name='user_del'),
    url(r'^user/ustatus$',views.ustatus,name='user_status'),

    # 后台商品分类管理
    url(r'^type/add$', typeviews.typeadd, name='type_add'),
    url(r'^type/insert$', typeviews.typeinsert, name='type_insert'),
    url(r'^type/list$', typeviews.typelist, name='type_list'),
    url(r'^type/edit/([0-9]+)$', typeviews.typeedit, name='type_edit'),
    url(r'^type/save$', typeviews.typesave, name='type_save'),
    url(r'^type/del$', typeviews.typedel, name='type_del'),

    # 后台商品管理
    url(r'^goods/add$', goodsviews.goodsadd, name='goods_add'),
    url(r'^goods/insert$', goodsviews.goodsinsert, name='goods_insert'),
    url(r'^goods/list$', goodsviews.goodslist, name='goods_list'),
    url(r'^goods/edit/([0-9]+)$', goodsviews.goodsedit, name='goods_edit'),
    url(r'^goods/save$', goodsviews.goodssave, name='goods_save'),
    url(r'^goods/del/([0-9]+)$', goodsviews.goodsdel, name='goods_del'),
    url(r'^goods/goodsstatus$',goodsviews.goodsstatus,name='goods_status'),

    # 后台订单管理
    url(r'^order/list$', order.orderlist, name='orderlist'),
    url(r'^order/orderstatus$', order.orderstatus, name='orderstatus'),
    url(r'^order/orderinfo/([0-9]+)$', order.orderinfo, name='orderinfo'),

]
